var arr = [];
var length = 6;
for(var i=0;i<length;i++){
    arr[] = i+1;
}

arr = [1,2,3,4,5,6];

var tmp;

for(var i=0;i<arr.length;i++){
    //如果是开头就拿出来放到缓存中呆着
    if(i==0){
         tmp = arr[0];
    //否则如果是末尾就把缓存的内容放入末尾
     }else if(i==arr.length-1){
         arr[i] = tmp;
         //arr[5] = tmp;
     //否则依次把内容替换前一个对象
     }else{
        arr[i-1] = arr[i];
        //arr[0] = arr[1];
        //arr[1] = arr[2];
        //arr[2] = arr[3];
        //arr[3] = arr[4];
        //arr[4] = arr[5];
     }
}




var arr = [];
var length = 6;
for(var i=0;i<length;i++){
    arr[]=i+1;
}

arr = [1,2,3,4,5,6];
var tmp ;
for(var i=arr.length;i>0;i--){
    if(i==arr.length-1){
        tmp = arr[0];
        //tmp = arr[5];
    }else if(i==0){
        arr[i] = tmp;
        //arr[0] = tmp;
    }else{
        arr[i+1] = arr[i];
        //arr[5] = arr[4];
        //arr[4] = arr[3];
        //arr[3] = arr[2];
        //arr[2] = arr[1];
        //arr[1] = arr[0];
    }
}

